package com.gitee.free.coding.admin.system.req;

import com.gitee.free.coding.core.group.LoginGroup;
import com.gitee.free.coding.core.group.RegisterGroup;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;

@Data
public class SystemLoginReq implements Serializable {

    /**
     * 用户登录名
     */
    @NotBlank(message = "用户登录名不能为空", groups = {RegisterGroup.class, LoginGroup.class})
    @Size(max = 128, message = "用户登录名长度不能超过128", groups = {RegisterGroup.class, LoginGroup.class})
    private String userName;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空", groups = {RegisterGroup.class, LoginGroup.class})
    private String password;

    /**
     * 验证码的唯一标识
     */
    @NotBlank(message = "验证码的唯一标识不能为空", groups = {RegisterGroup.class, LoginGroup.class})
    private String uniqueIdentifier;

    /**
     * 验证码
     */
    @NotBlank(message = "验证码不能为空", groups = {RegisterGroup.class, LoginGroup.class})
    private String verificationCode;

    /**
     * 用户代理 -- 用于获取用户登录设备等信息
     */
    @NotBlank(message = "用户代理不能为空", groups = {LoginGroup.class})
    private String userAgent;

    /**
     * 客户端IP地址
     */
    @NotBlank(message = "客户端IP地址不能为空", groups = {LoginGroup.class})
    private String ipAddress;
}
